package suzf.top.base.rx

import rx.Subscriber
import suzf.top.base.presenter.view.BaseView

/**
 *
 *========================
 * Created with AndroidStudio
 * Author:Mr.Su
 * Date:2019-09-08
 * Time:10:32
 * ========================
 */
open class BaseSubscriber<T>(val baseView: BaseView): Subscriber<T>() {

    override fun onCompleted() {
        baseView.hideLoading()
    }

    override fun onError(e: Throwable?) {
        baseView.hideLoading()
        if (e is BaseException) {
            baseView.onError(e.msg)
        }
    }

    override fun onNext(t: T) {
    }
}